<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?= HTML::style('css/style.css'); ?>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                var link = window.location.href;
                if(link.indexOf('/member')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:first');
                    li.attr('class','active');   
                }
                if(link.indexOf('/projects')!=-1){
                    var li = $('.b-menu-as-dropdown').children("li:eq(1)");
                    li.attr('class','active');   
                }
                if(link.indexOf('/metrika/traffic')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(2)');
                    li.attr('class','active');   
                }
                if(link.indexOf('/sources_summary')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(3)');
                    li.attr('class','active');   
                }
                if(link.indexOf('/sources_engines')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(4)');
                    li.attr('class','active');   
                }
                if(link.indexOf('/sources_phrases')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(5)');
                    li.attr('class','active');   
                }
                if(link.indexOf('/geo')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(6)');
                    li.attr('class','active');   
                }
                if(link.indexOf('/content')!=-1){
                    var li = $('.b-menu-as-dropdown').children('li:eq(7)');
                    li.attr('class','active');   
                }
                
                
            });
        </script>
        <title><?= isset($title) ? $title : "" ?></title> 
    </head>
    <body>
        <div class="top_menu">
            <ul class="b-menu-as-dropdown">
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/member/', 'Главная'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <? if ($project_id == 0): ?>
                            <?= HTML::anchor('/projects/', 'Проекты'); ?>
                        <? else: ?>
                            <?= HTML::anchor('/projects/' . $project_id, 'Позиции'); ?>
                        <? endif; ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/traffic/', 'Посещаемость'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/sources_summary/', 'Источники'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/sources_engines/', 'Поисковые системы'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/sources_phrases/', 'Поисковые фразы'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/geo/', 'География'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/metrika/content/', 'Популярное'); ?>
                    </div>
                </li>
                <li>
                    <div class="b-menu-as-dropdown-header">
                        <?= HTML::anchor('/login/logout/', 'Выйти'); ?>
                    </div>
                </li>
            </ul>
            <div class="clear"></div>
        </div>
        <div style="clear: both;"></div>
        <div class="content">
            <?= $content; ?>
        </div>
    </body>
</html>
